/**
 * 一级菜单点击监听事件
 * @param {} e
 */
function onMenuButtonClick(e){
	var button = e.sender;
	var text = button.text;
	var id = button.id;
	
	if(text == "首页"){
		var menuTabs = mini.get("menu-tabs-div");
		menuTabs.activeTab(menuTabs.getTab(0));
		return;
	}
	
	mini.parse();
	var menuListTree = mini.get("menu-lists-tree");
	var mainSplitter = mini.get("mainSplitterDiv");
	var mainLeftLayout = mini.get("mainLeftLayout");

	if(!mainSplitter.getPane(1).visible){
		mainSplitter.showPane(1);
	}
	
	var leftMenuDiv = mainLeftLayout.regions[0];
	mainLeftLayout.updateRegion("west",{title: text});
	
	switch(id){
		case "goodsMgr":
			removeLeftTree(menuListTree);
			menuListTree.loadData(menuObj.goodsMgrTree);
			break;
		case "ordersMgr":
			removeLeftTree(menuListTree);
			menuListTree.loadData(menuObj.ordersMgrTree);
			break;
		case "membersMgr":
			removeLeftTree(menuListTree);
			menuListTree.loadData(menuObj.membersMgrTree);
			break;
		case "articlesMgr":
			removeLeftTree(menuListTree);
			menuListTree.loadData(menuObj.articlesMgrTree);
			break;
		case "webMgr":
			removeLeftTree(menuListTree);
			menuListTree.loadData(menuObj.webMgrTree);
			break;
		case "systemMgr":
			removeLeftTree(menuListTree);
			menuListTree.loadData(menuObj.systemMgrTree);
			break;
		default:
			break;
	}
}

/**
 * 清空左侧菜单树
 * @param {} menuListsTree
 */
function removeLeftTree(menuListTree){
	menuListTree.loadData(null);
}